home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
dev
/
lang
/
SmallEiffel.lha
/
SmallEiffel
/
bin_c
/
compile_to_jvm42.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-12-22
|
13KB
|
668 lines
/*
-- ANSI C code generated by :
-- SmallEiffel The GNU Eiffel Compiler -- Release (- 0.79) --
-- Copyright (C), 1994-98 - LORIA - UHP - CRIN - INRIA - FRANCE --
-- Dominique COLNET and Suzanne COLLIN - colnet@loria.fr --
-- http://www.loria.fr/SmallEiffel --
*/
#include "compile_to_jvm.h"
T0* r234result_type(T234* C){
T0* R=NULL;
R=X109result_type((C)->_expression/*4*/);
return R;
}
void r234error(T0* a1,T0* a2){
r21add_position(a1);
r21error((T21*)(oBC12eh),a2);
}
void r234make(T234* C,T0* a1,T0* a2){
C->_expression=a1;
C->_comment=a2;
}
void r234compile_to_jvm_assignment(T234* C,T0* a1){
X109compile_to_jvm_assignment((C)->_expression/*4*/,a1);
}
T6 r234is_current(T234* C){
T6 R=0;
R=X109is_current((C)->_expression/*4*/);
return R;
}
T6 r234is_void(T234* C){
T6 R=0;
R=X109is_void((C)->_expression/*4*/);
return R;
}
void r234compile_to_jvm_old(T234* C){
X109compile_to_jvm_old((C)->_expression/*4*/);
}
void r234jvm_assign(T234* C){
X109jvm_assign((C)->_expression/*4*/);
}
T2 r234jvm_branch_if_false(T234* C){
T2 R=0;
R=X109jvm_branch_if_false((C)->_expression/*4*/);
return R;
}
/*No:EXPRESSION_WITH_COMMENT.comment*/
void r234compile_to_jvm(T234* C){
X109compile_to_jvm((C)->_expression/*4*/);
}
void r234afd_check(T234* C){
X109afd_check((C)->_expression/*4*/);
}
T6 r234is_result(T234* C){
T6 R=0;
R=X109is_result((C)->_expression/*4*/);
return R;
}
T2 r146static_value(T146* C){
T2 R=0;
/*[IF*/
if(X52is_integer(X109result_type((C)->_target/*4*/))){
/*[IF*/
if(X109is_static((C)->_target/*4*/)){
R=-(X109static_value((C)->_target/*4*/));
}
/*FI]*/
}
/*FI]*/
return R;
}
/*No:CALL_PREFIX_MINUS.feature_name*/
T6 r146is_static(T146* C){
T6 R=0;
/*[IF*/
if(X52is_integer(X109result_type((C)->_target/*4*/))){
/*[IF*/
if(X109is_static((C)->_target/*4*/)){
R=1;
}
/*FI]*/
}
/*FI]*/
return R;
}
/*No:CALL_PREFIX_MINUS.is_manifest_string*/
T0* r146start_position(T146* C){
T0* R=NULL;
R=((T145*)((C)->_feature_name/*12*/))->_start_position/*8*/;
return R;
}
T0* r146add_comment(T146* C,T0* a1){
T0* R=NULL;
/*[IF*/
if(((a1)==((void*)(NULL)))||((/*(IRF4.6count*/r73count(((T73*)((((T85*)a1))->_list/*4*/)))/*)*/)==(0))){
R=(T0*)C;
}
else{
{T234*n=malloc(sizeof(*n));
*n=M234;
r234make(n,(T0*)C,a1);
R=(T0*)n;
}
}
/*FI]*/
return R;
}
T2 r146to_integer(T146* C){
T2 R=0;
T0* _rf1=NULL;
_rf1=(C)->_run_feature/*8*/;
if(NULL!=(_rf1))switch(((T0*)_rf1)->id) {
case 372:
break;
default:
_rf1=NULL;
};/*[IF*/
if((_rf1)==((void*)(NULL))){
r146error(r146start_position(C),((T0*)ms13_45846));
}
else{
R=X109to_integer((((T372*)_rf1))->_value/*36*/);
}
/*FI]*/
return R;
}
T6 r146use_current(T146* C){
T6 R=0;
/*[IF*/
/*AF*//*AE*/
/*FI]*/
/*[IF*/
if(R){
}
else if(X109is_current((C)->_target/*4*/)){
R=X27use_current((C)->_run_feature/*8*/);
}
else{
R=X109use_current((C)->_target/*4*/);
}
/*FI]*/
return R;
}
/*No:CALL_PREFIX_MINUS.jvm_branch_if_true*/
T0* r146to_runnable(T146* C,T0* a1){
T0* R=NULL;
T0* _rf=NULL;
T0* _t=NULL;
_t=r146runnable_expression((C)->_target/*4*/,a1);
_rf=r146run_feature_for(C,_t,a1);
/*[IF*/
if(((C)->_run_feature/*8*/)==((void*)(NULL))){
C->_target=_t;
C->_run_feature=_rf;
r146run_feature_match(C);
R=(T0*)C;
}
else if((_t)==((void*)((C)->_target/*4*/))){
R=(T0*)C;
}
else{
{T146*n=malloc(sizeof(*n));
*n=M146;
r146with(n,_t,(C)->_feature_name/*12*/,_rf);
R=(T0*)n;
}
}
/*FI]*/
return R;
}
T2 r146compile_to_jvm_into(T146* C,T0* a1){
T2 R=0;
R=r146standard_compile_to_jvm_into(C,a1);
return R;
}
/*No:CALL_PREFIX_MINUS.is_pre_computable*/
/*No:CALL_PREFIX_MINUS.fz_iinaiv*/
T0* r146result_type(T146* C){
T0* R=NULL;
R=X27result_type((C)->_run_feature/*8*/);
/*[IF*/
if(X52is_like_current(R)){
R=/*X27current_type*/((T0*)((T26*)((C)->_run_feature/*8*/))->_current_type/*4*/);
}
/*FI]*/
return R;
}
/*No:CALL_PREFIX_MINUS.run_feature*/
void r146standard_compile_target_to_jvm(T146* C){
/*[IRF3.4compile_to_jvm*//*[IRF3.6call_proc_call_c2jvm*/{T146* C1=C;
r24call_proc_call_mapping((T24*)(oBC12jvm),(T0*)C1);
}/*]*/
/*]*/
X52jvm_check_class_invariant(r146result_type(C));
}
/*No:CALL_PREFIX_MINUS.compile_to_jvm_assignment*/
/*No:CALL_PREFIX_MINUS.fz_07*/
void r146compile_to_jvm_old(T146* C){
X109compile_to_jvm_old((C)->_target/*4*/);
/*[IF*/
/*AF*//*AE*/
/*FI]*/
}
/*No:CALL_PREFIX_MINUS.jvm_assign*/
/*No:CALL_PREFIX_MINUS.jvm_branch_if_false*/
/*No:CALL_PREFIX_MINUS.compile_to_jvm*/
/*No:CALL_PREFIX_MINUS.arg_count*/
void r146with(T146* C,T0* a1,T0* a2,T0* a3){
C->_target=a1;
C->_feature_name=a2;
C->_run_feature=a3;
r146run_feature_match(C);
}
/*No:CALL_PREFIX_MINUS.call_proc_call_c2jvm*/
/*No:CALL_PREFIX_MINUS.is_result*/
/*No:CALL_PREFIX_MINUS.fatal_error*/
/*No:CALL_PREFIX_MINUS.us_minus*/
void r146run_feature_match(T146* C){
r146run_feature_has_result(C);
/*[IF*/
if((X27arg_count((C)->_run_feature/*8*/))>(0)){
r21add_position(((T145*)((C)->_feature_name/*12*/))->_start_position/*8*/);
r21add_position(X27start_position((C)->_run_feature/*8*/));
/*[IRF3.6fatal_error*/{T0* b1=((T0*)ms144_50512);
r21fatal_error((T21*)(oBC12eh),b1);
}/*]*/
}
/*FI]*/
}
/*No:CALL_PREFIX_MINUS.arguments*/
T0* r146runnable_expression(T0* a1,T0* a2){
T0* R=NULL;
R=X109to_runnable(a1,a2);
/*[IF*/
if((R)==((void*)(NULL))){
r21add_position(X109start_position(a1));
/*[IRF3.6fatal_error*/{T0* b1=((T0*)ms121_16515);
r21fatal_error((T21*)(oBC12eh),b1);
}/*]*/
}
/*FI]*/
return R;
}
T6 r146can_be_dropped(T146* C){
T6 R=0;
/*[IF*/
if(X109can_be_dropped((C)->_target/*4*/)){
R=X27can_be_dropped((C)->_run_feature/*8*/);
}
/*FI]*/
return R;
}
/*No:CALL_PREFIX_MINUS.compile_target_to_jvm*/
T2 r146isa_dca_inline_argument(T146* C){
T2 R=0;
/*[IF*/
if(X52is_integer(r146result_type(C))){
R=X109isa_dca_inline_argument((C)->_target/*4*/);
}
/*FI]*/
return R;
}
void r146run_feature_has_result(T146* C){
/*[IF*/
if((X27result_type((C)->_run_feature/*8*/))==((void*)(NULL))){
r21add_position(X27start_position((C)->_run_feature/*8*/));
r21add_position(((T145*)((C)->_feature_name/*12*/))->_start_position/*8*/);
/*[IRF3.6fatal_error*/{T0* b1=((T0*)ms120_53650);
r21fatal_error((T21*)(oBC12eh),b1);
}/*]*/
}
/*FI]*/
}
T2 r146jvm_standard_branch_if_false(T146* C){
T2 R=0;
/*[IRF3.4compile_to_jvm*//*[IRF3.6call_proc_call_c2jvm*/{T146* C1=C;
r24call_proc_call_mapping((T24*)(oBC12jvm),(T0*)C1);
}/*]*/
/*]*/
R=r28opcode_ifeq((T28*)(oBC12code_attribute));
return R;
}
T0* r146run_feature_for(T146* C,T0* a1,T0* a2){
T0* R=NULL;
T0* _rc=NULL;
_rc=X52run_class(X109result_type(a1));
R=r23get_rf(((T23*)_rc),a1,(C)->_feature_name/*12*/,a2);
return R;
}
/*No:CALL_PREFIX_MINUS.target*/
void r146error(T0* a1,T0* a2){
r21add_position(a1);
r21error((T21*)(oBC12eh),a2);
}
void r146make(T146* C,T0* a1,T0* a2){
{T145*n=malloc(sizeof(*n));
*n=M145;
r145make(n,r146operator(),a1);
C->_feature_name=(T0*)n;
}
C->_target=a2;
}
/*No:CALL_PREFIX_MINUS.is_current*/
T2 r146standard_compile_to_jvm_into(T146* C,T0* a1){
T2 R=0;
/*[IRF3.4compile_to_jvm*//*[IRF3.6call_proc_call_c2jvm*/{T146* C1=C;
r24call_proc_call_mapping((T24*)(oBC12jvm),(T0*)C1);
}/*]*/
/*]*/
R=X52jvm_convert_to(X52run_type(r146result_type(C)),a1);
return R;
}
/*No:CALL_PREFIX_MINUS.is_void*/
T0* r146operator(void){
T0* R=NULL;
R=((T0*)ms14_46);
return R;
}
T2 r146jvm_standard_branch_if_true(T146* C){
T2 R=0;
/*[IRF3.4compile_to_jvm*//*[IRF3.6call_proc_call_c2jvm*/{T146* C1=C;
r24call_proc_call_mapping((T24*)(oBC12jvm),(T0*)C1);
}/*]*/
/*]*/
R=r28opcode_ifne((T28*)(oBC12code_attribute));
return R;
}
void r146afd_check(T146* C){
T0* _running=NULL;
T0* _rc=NULL;
_rc=X52run_class(X109result_type((C)->_target/*4*/));
_running=(((T23*)_rc))->_running/*12*/;
/*[IF*/
if((_running)==((void*)(NULL))){
r21add_position(X109start_position((C)->_target/*4*/));
/*[IRF3.6append*/{T0* b1=((T0*)ms121_181815);
r7append((T7*)(oBC21explanation),b1);
}/*]*/
/*[IRF3.6append*/{T0* b1=X52run_time_mark((((T23*)_rc))->_current_type/*0*/);
r7append((T7*)(oBC21explanation),b1);
}/*]*/
/*[IRF3.6append*/{T0* b1=((T0*)ms13_20094);
r7append((T7*)(oBC21explanation),b1);
}/*]*/
r21print_as_warning((T21*)(oBC12eh));
r23set_at_run_time(((T23*)_rc));
}
else if((r340count(((T340*)_running)))>(1)){
r335update((C)->_target/*4*/,(C)->_run_feature/*8*/);
}
/*FI]*/
X109afd_check((C)->_target/*4*/);
/*[IF*/
/*AF*//*AE*/
/*FI]*/
}
/*No:E_FALSE.static_value*/
T0* r172type_boolean(void){
if(fBC12type_boolean==0){
fBC12type_boolean=1;
{T268*n=malloc(sizeof(*n));
*n=M268;
r268make(n,NULL);
oBC12type_boolean=(T0*)n;
}
}
return oBC12type_boolean;}
/*No:E_FALSE.is_static*/
/*No:E_FALSE.can_be_dropped*/
/*No:E_FALSE.is_manifest_string*/
/*No:E_FALSE.start_position*/
T0* r172add_comment(T172* C,T0* a1){
T0* R=NULL;
/*[IF*/
if(((a1)==((void*)(NULL)))||((/*(IRF4.6count*/r73count(((T73*)((((T85*)a1))->_list/*4*/)))/*)*/)==(0))){
R=(T0*)C;
}
else{
{T234*n=malloc(sizeof(*n));
*n=M234;
r234make(n,(T0*)C,a1);
R=(T0*)n;
}
}
/*FI]*/
return R;
}
/*No:E_FALSE.compile_target_to_jvm*/
/*No:E_FALSE.to_integer*/
/*No:E_FALSE.use_current*/
T2 r172jvm_branch_if_true(void){
T2 R=0;
/*[IRF3.4opcode_iconst_0*/r28opcode((T28*)(oBC12code_attribute),3,1);
/*]*/
R=r28opcode_ifeq((T28*)(oBC12code_attribute));
return R;
}
/*No:E_FALSE.to_runnable*/
T2 r172compile_to_jvm_into(T0* a1){
T2 R=0;
R=r172standard_compile_to_jvm_into(a1);
return R;
}
T2 r172isa_dca_inline_argument(void){
T2 R=0;
/*[IF*/
{/*AT*/R=-(1);
}
/*FI]*/
return R;
}
/*No:E_FALSE.is_pre_computable*/
/*No:E_FALSE.fz_iinaiv*/
/*No:E_FALSE.result_type*/
void r172error(T0* a1,T0* a2){
r21add_position(a1);
r21error((T21*)(oBC12eh),a2);
}
/*No:E_FALSE.make*/
/*No:E_FALSE.compile_to_jvm_assignment*/
/*No:E_FALSE.is_current*/
T2 r172standard_compile_to_jvm_into(T0* a1){
T2 R=0;
/*[IRF3.2compile_to_jvm*//*[IRF3.4opcode_iconst_0*/r28opcode((T28*)(oBC12code_attribute),3,1);
/*]*/
/*]*/
R=X52jvm_convert_to(/*(IRF4.4run_type*/((T0*)((T268*)/*(IRF4.8result_type*/r172type_boolean()/*)*/))/*)*/,a1);
return R;
}
/*No:E_FALSE.is_void*/
/*No:E_FALSE.compile_to_jvm_old*/
/*No:E_FALSE.jvm_assign*/
/*No:E_FALSE.jvm_branch_if_false*/
/*No:E_FALSE.compile_to_jvm*/
/*No:E_FALSE.afd_check*/
/*No:E_FALSE.is_result*/
/*No:ARGUMENT_NAME2.static_value*/
/*No:ARGUMENT_NAME2.is_static*/
/*No:ARGUMENT_NAME2.is_manifest_string*/
/*No:ARGUMENT_NAME2.start_position*/
T0* r192to_string(T192* C){
T0* R=NULL;
R=((T194*)(/*(IRF4.6name*/r195item(((T195*)(((T191*)((C)->_formal_arg_list/*12*/))->_flat_list/*8*/)),(C)->_rank/*8*/)/*)*/))->_to_string/*8*/;
return R;
}
T0* r192add_comment(T192* C,T0* a1){
T0* R=NULL;
/*[IF*/
if(((a1)==((void*)(NULL)))||((/*(IRF4.6count*/r73count(((T73*)((((T85*)a1))->_list/*4*/)))/*)*/)==(0))){
R=(T0*)C;
}
else{
{T234*n=malloc(sizeof(*n));
*n=M234;
r234make(n,(T0*)C,a1);
R=(T0*)n;
}
}
/*FI]*/
return R;
}
T2 r192to_integer(T192* C){
T2 R=0;
r192error((C)->_start_position/*4*/,((T0*)ms13_45846));
return R;
}
/*No:ARGUMENT_NAME2.rank*/
/*No:ARGUMENT_NAME2.use_current*/
T2 r192jvm_branch_if_true(T192* C){
T2 R=0;
r192compile_to_jvm(C);
R=r28opcode_ifne((T28*)(oBC12code_attribute));
return R;
}
T0* r192to_runnable(T192* C,T0* a1){
T0* R=NULL;
T0* _fal=NULL;
T0* _rf=NULL;
_rf=r22top_rf((T22*)(oBC12small_eiffel));
_fal=X27arguments(_rf);
/*[IF*/
if(((C)->_formal_arg_list/*12*/)==((void*)(_fal))){
R=(T0*)C;
}
else{
{T192*n=malloc(sizeof(*n));
*n=M192;
r192with(n,(T0*)C,_fal);
R=(T0*)n;
}
}
/*FI]*/
return R;
}
T2 r192compile_to_jvm_into(T192* C,T0* a1){
T2 R=0;
R=r192standard_compile_to_jvm_into(C,a1);
return R;
}
/*No:ARGUMENT_NAME2.is_pre_computable*/
/*No:ARGUMENT_NAME2.fz_iinaiv*/
T0* r192result_type(T192* C){
T0* R=NULL;
R=r191type((T191*)((C)->_formal_arg_list/*12*/),(C)->_rank/*8*/);
return R;
}
void r192standard_compile_target_to_jvm(T192* C){
r192compile_to_jvm(C);
X52jvm_check_class_invariant(r192result_type(C));
}
/*No:ARGUMENT_NAME2.compile_to_jvm_assignment*/
/*No:ARGUMENT_NAME2.compile_to_jvm_old*/
/*No:ARGUMENT_NAME2.jvm_assign*/
T2 r192jvm_branch_if_false(T192* C){
T2 R=0;
r192compile_to_jvm(C);
R=r28opcode_ifeq((T28*)(oBC12code_attribute));
return R;
}
void r192compile_to_jvm(T192* C){
T2 _jvm_offset=0;
_jvm_offset=r24argument_offset_of((T24*)(oBC12jvm),(T0*)C);
X52jvm_push_local(X52run_type(r192result_type(C)),_jvm_offset);
}
void r192with(T192* C,T0* a1,T0* a2){
*((T192*)(C))=*((T192*)(a1));
C->_formal_arg_list=a2;
}
/*No:ARGUMENT_NAME2.is_result*/
/*No:ARGUMENT_NAME2.can_be_dropped*/
/*No:ARGUMENT_NAME2.compile_target_to_jvm*/
/*No:ARGUMENT_NAME2.isa_dca_inline_argument*/
/*No:ARGUMENT_NAME2.formal_arg_list*/
void r192refer_to(T192* C,T0* a1,T0* a2,T2 a3){
C->_start_position=a1;
C->_formal_arg_list=a2;
C->_rank=a3;
}
void r192error(T0* a1,T0* a2){
r21add_position(a1);
r21error((T21*)(oBC12eh),a2);
}
/*No:ARGUMENT_NAME2.is_current*/
T2 r192standard_compile_to_jvm_into(T192* C,T0* a1){
T2 R=0;
r192compile_to_jvm(C);
R=X52jvm_convert_to(X52run_type(r192result_type(C)),a1);
return R;
}
/*No:ARGUMENT_NAME2.is_void*/
/*No:ARGUMENT_NAME2.afd_check*/